<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" >

	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
	<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css?family=Cousine|Inconsolata" rel="stylesheet">
	<link rel="shortcut icon" type="image/png" href="/favicon.png">

	
	<link rel="stylesheet" href="/css/style.css">
	<link rel="stylesheet" href="/css/css/fontawesome-all.min.css">
	<script src="/js/main.js"></script>
	

	<!-- Begin Jekyll SEO tag v2.1.0 -->
<title>jussi - Steem Developer</title>
<meta property="og:title" content="jussi" />
<meta name="description" content="A reverse proxy that forwards json-rpc requests." />
<meta property="og:description" content="A reverse proxy that forwards json-rpc requests." />
<link rel="canonical" href="https://developer.steem.io/services/jussi" />
<meta property="og:url" content="https://developer.steem.io/services/jussi" />
<meta property="og:site_name" content="Steem Developer" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2018-07-20T12:56:08-05:00" />
<script type="application/ld+json">
{"@context": "http://schema.org",
"@type": "BlogPosting",
"headline": "jussi",
"datePublished": "2018-07-20T12:56:08-05:00",
"description": "A reverse proxy that forwards json-rpc requests.",
"url": "https://developer.steem.io/services/jussi"}</script>
<!-- End Jekyll SEO tag -->


	
</head>
<body>
<header>
	<h1>
		<button type="button" class="open-nav" id="open-nav"></button>
		<a href="/"  class="logo-link"><img src="/images/logotype_white.svg" height="40" alt="Steem Developer logo"></a>
	</h1>

	
	<form action="/search/" method="get">
		<input type="text" name="q" id="search-input" placeholder="Search">
		<input type="submit" value="Search" style="display: none;">
	</form>
	

	<div id="sidebar" class="sidebar">
	
	
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/">
		<h6 class="ctrl-nav-section title">Introduction</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/#introduction-welcome">Welcome to Steem</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/quickstart/">
		<h6 class="ctrl-nav-section title">Quickstart</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/quickstart/#quickstart-choose-library">Choose Library</a></li>
						
					
						
						<li><a href="/quickstart/#quickstart-steemd-nodes">steemd Nodes</a></li>
						
					
						
						<li><a href="/quickstart/#quickstart-testnet">Steem Testnet</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/tutorials/">
		<h6 class="ctrl-nav-section title">Tutorials</h6>
		<ul class="cont-nav-section content">
			
				
					
						<li><a href="/tutorials/#tutorials-javascript">Javascript</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-python">Python</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-ruby">Ruby</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-recipes">Recipes</a></li>
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/services/">
		<h6 class="ctrl-nav-section title">Services</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/services/#services-steemit">Steemit.com</a></li>
						
					
						
						<li><a href="/services/#services-steemconnect">SteemConnect</a></li>
						
					
						
						<li><a href="/services/#services-jussi">jussi</a></li>
						
					
						
						<li><a href="/services/#services-imagehoster">ImageHoster</a></li>
						
					
						
						<li><a href="/services/#services-sbds">SBDS</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/apidefinitions/">
		<h6 class="ctrl-nav-section title">Appbase API</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/apidefinitions/#apidefinitions-condenser-api">Condenser Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-account-by-key-api">Account By Key Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-broadcast-ops-comment">Broadcast Ops Comment</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-account-history-api">Account History Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-database-api">Database Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-follow-api">Follow Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-jsonrpc">Jsonrpc</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-market-history-api">Market History Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-network-broadcast-api">Network Broadcast Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-tags-api">Tags Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-witness-api">Witness Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-block-api">Block Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-broadcast-ops">Broadcast Ops</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/community/">
		<h6 class="ctrl-nav-section title">Community</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/community/#community-overview">Overview</a></li>
						
					
						
						<li><a href="/community/#community-resources">Resources</a></li>
						
					
						
						<li><a href="/community/#community-developeradvocate">Sharing & Help</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/glossary/">
		<h6 class="ctrl-nav-section title">Glossary</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/glossary/#glossary-chain-basics">Chain Basics</a></li>
						
					
						
					
						
						<li><a href="/glossary/#glossary-governance">Governance</a></li>
						
					
						
						<li><a href="/glossary/#glossary-transactions">Transactions</a></li>
						
					
						
						<li><a href="/glossary/#glossary-api">API</a></li>
						
					
						
						<li><a href="/glossary/#glossary-market">Market</a></li>
						
					
				
			
		</ul>
	</section>
	
</div>


	<!--<p class="copyright">-->
	<!--<a href="https://steemit.com.com/">-->
	<!--steemit-->
	<!--</a>-->
	<!--</p>-->
	<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
</header>
<div class="main" id="top">
	<div class="hero">
		<h1 class="hero__h1">Steem Developer Portal </h1>
		
		<img class="hero__img" src="/images/hero.png">
		
	</div>
	<p>Jussi is a custom-built caching layer for use with <code class="highlighter-rouge">steemd</code> and other various services (such as <a href="/services/#services-sbds">SBDS</a>).</p>

<p>The purpose of this document is to help developers and node operators set up their own jussi node within a docker container.</p>

<h3 id="intro">Intro</h3>

<p>Jussi is a reverse proxy that is situation between the API client and the <code class="highlighter-rouge">steemd</code> server.  It allows node operators to route an API call to nodes that are optimized for the particular call, as if they are all hosted from the same place.</p>

<h3 id="sections">Sections</h3>

<ul>
  <li><a href="#installation">Installation</a></li>
  <li><a href="#adding-upstreams">Adding Upstreams</a></li>
  <li><a href="#benefits-of-jussi">Benefits of jussi</a>
    <ul>
      <li><a href="#time-to-live">TTL</a></li>
      <li><a href="#json-rpc-batch">json-rpc batch</a></li>
    </ul>
  </li>
  <li><a href="#footnotes">Footnotes</a></li>
</ul>

<h3 id="installation">Installation<a style="float: right" href="#sections"><i class="fas fa-chevron-up fa-sm"></i></a></h3>

<h5 id="to-run-jussi-locally">To run <code class="highlighter-rouge">jussi</code> locally:</h5>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>git clone https://github.com/steemit/jussi.git
<span class="nb">cd </span>jussi
docker build -t<span class="o">=</span><span class="s2">"</span><span class="nv">$USER</span><span class="s2">/jussi:</span><span class="k">$(</span>git rev-parse --abbrev-ref HEAD<span class="k">)</span><span class="s2">"</span> .
docker run -itp 9000:8080 <span class="s2">"</span><span class="nv">$USER</span><span class="s2">/jussi:</span><span class="k">$(</span>git rev-parse --abbrev-ref HEAD<span class="k">)</span><span class="s2">"</span>
</code></pre>
</div>

<p><img src="/images/services-jussi/kitematic-example.png" width="100%" alt="Kitematic Example" />
<small><em>jussi in a docker container as seen from <a href="https://docs.docker.com/docker-for-mac/install/">Kitematic for macOS</a>.</em></small></p>

<h5 id="try-out-your-local-configuration">Try out your local configuration:</h5>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>curl -s --data <span class="s1">'{"jsonrpc":"2.0", "method":"condenser_api.get_block", "params":[8675309], "id":1}'</span> http://localhost:9000
</code></pre>
</div>

<p>See: <a href="https://steemit.com/steemdev/@maitland/running-condenser-jussi-and-a-new-service-locally-adding-feature-flags-to-condenser">Running Condenser, Jussi and a new service locally + adding feature flags to Condenser</a></p>

<hr />

<h3 id="adding-upstreams">Adding Upstreams<a style="float: right" href="#sections"><i class="fas fa-chevron-up fa-sm"></i></a></h3>

<p>The default <code class="highlighter-rouge">DEV_config.json</code> is:</p>

<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
   </span><span class="nt">"limits"</span><span class="p">:{</span><span class="nt">"blacklist_accounts"</span><span class="p">:[</span><span class="s2">"non-steemit"</span><span class="p">]},</span><span class="w">
   </span><span class="nt">"upstreams"</span><span class="p">:[</span><span class="w">
      </span><span class="p">{</span><span class="w">
         </span><span class="nt">"name"</span><span class="p">:</span><span class="s2">"steemd"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"translate_to_appbase"</span><span class="p">:</span><span class="kc">false</span><span class="p">,</span><span class="w">
         </span><span class="nt">"urls"</span><span class="p">:[[</span><span class="s2">"steemd"</span><span class="p">,</span><span class="w"> </span><span class="s2">"https://steemd.steemitdev.com"</span><span class="p">]],</span><span class="w">
         </span><span class="nt">"ttls"</span><span class="p">:[</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd"</span><span class="p">,</span><span class="w"> </span><span class="mi">3</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.login_api"</span><span class="p">,</span><span class="w"> </span><span class="mi">-1</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.network_broadcast_api"</span><span class="p">,</span><span class="w"> </span><span class="mi">-1</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.follow_api"</span><span class="p">,</span><span class="w"> </span><span class="mi">10</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.market_history_api"</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.database_api"</span><span class="p">,</span><span class="w"> </span><span class="mi">3</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.database_api.get_block"</span><span class="p">,</span><span class="w"> </span><span class="mi">-2</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.database_api.get_block_header"</span><span class="p">,</span><span class="w"> </span><span class="mi">-2</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.database_api.get_content"</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.database_api.get_state"</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.database_api.get_state.params=['/trending']"</span><span class="p">,</span><span class="w"> </span><span class="mi">30</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.database_api.get_state.params=['trending']"</span><span class="p">,</span><span class="w"> </span><span class="mi">30</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.database_api.get_state.params=['/hot']"</span><span class="p">,</span><span class="w"> </span><span class="mi">30</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.database_api.get_state.params=['/welcome']"</span><span class="p">,</span><span class="w"> </span><span class="mi">30</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.database_api.get_state.params=['/promoted']"</span><span class="p">,</span><span class="w"> </span><span class="mi">30</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.database_api.get_state.params=['/created']"</span><span class="p">,</span><span class="w"> </span><span class="mi">10</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.database_api.get_dynamic_global_properties"</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">]</span><span class="w">
         </span><span class="p">],</span><span class="w">
         </span><span class="nt">"timeouts"</span><span class="p">:[</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd"</span><span class="p">,</span><span class="w"> </span><span class="mi">5</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"steemd.network_broadcast_api"</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">]</span><span class="w">
         </span><span class="p">]</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="p">{</span><span class="w">
         </span><span class="nt">"name"</span><span class="p">:</span><span class="s2">"appbase"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"urls"</span><span class="p">:[[</span><span class="s2">"appbase"</span><span class="p">,</span><span class="w"> </span><span class="s2">"https://steemd.steemitdev.com"</span><span class="p">]],</span><span class="w">
         </span><span class="nt">"ttls"</span><span class="p">:[</span><span class="w">
            </span><span class="p">[</span><span class="s2">"appbase"</span><span class="p">,</span><span class="w"> </span><span class="mi">-2</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"appbase.block_api"</span><span class="p">,</span><span class="w"> </span><span class="mi">-2</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"appbase.database_api"</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">]</span><span class="w">
         </span><span class="p">],</span><span class="w">
         </span><span class="nt">"timeouts"</span><span class="p">:[</span><span class="w">
            </span><span class="p">[</span><span class="s2">"appbase"</span><span class="p">,</span><span class="w"> </span><span class="mi">3</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"appbase.chain_api.push_block"</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"appbase.chain_api.push_transaction"</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"appbase.network_broadcast_api"</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"appbase.condenser_api.broadcast_block"</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"appbase.condenser_api.broadcast_transaction"</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">],</span><span class="w">
            </span><span class="p">[</span><span class="s2">"appbase.condenser_api.broadcast_transaction_synchronous"</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">]</span><span class="w">
         </span><span class="p">]</span><span class="w">
      </span><span class="p">}</span><span class="w">
   </span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
</div>

<p>Upstreams can be added to the <code class="highlighter-rouge">upstreams</code> array:</p>

<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"foo"</span><span class="p">,</span><span class="w">
  </span><span class="nt">"urls"</span><span class="p">:</span><span class="w"> </span><span class="p">[[</span><span class="s2">"foo"</span><span class="p">,</span><span class="w"> </span><span class="s2">"https://foo.host.name"</span><span class="p">]],</span><span class="w">
  </span><span class="nt">"ttls"</span><span class="p">:</span><span class="w"> </span><span class="p">[[</span><span class="s2">"foo"</span><span class="p">,</span><span class="w"> </span><span class="mi">3</span><span class="p">]],</span><span class="w">
  </span><span class="nt">"timeouts"</span><span class="p">:</span><span class="w"> </span><span class="p">[[</span><span class="s2">"foo"</span><span class="p">,</span><span class="w"> </span><span class="mi">5</span><span class="p">]]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
</div>

<p>Once the above upstream is added to the local config and docker has been built, the following <code class="highlighter-rouge">curl</code> will work:</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>curl -s --data <span class="s1">'{"jsonrpc":"2.0", "method":"foo.bar", "params":["baz"], "id":1}'</span> http://localhost:9000
</code></pre>
</div>

<h3 id="benefits-of-jussi">Benefits of jussi<a style="float: right" href="#sections"><i class="fas fa-chevron-up fa-sm"></i></a></h3>

<h4 id="time-to-live">Time To Live<a style="float: right" href="#sections"><i class="fas fa-chevron-up fa-sm"></i></a></h4>

<p>Jussi can be configured with various <code class="highlighter-rouge">TTL</code> (Time To Live) schemes. A <code class="highlighter-rouge">TTL</code> is an integer value in seconds.  Integers equal to or less than <code class="highlighter-rouge">0</code> have special meaning.  A reasonable set of defaults would be:</p>

<table>
  <thead>
    <tr>
      <th>Upstream</th>
      <th>API</th>
      <th>Method</th>
      <th>Parameters</th>
      <th>TTL (seconds)</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code class="highlighter-rouge">steemd</code></td>
      <td><code class="highlighter-rouge">login_api</code></td>
      <td><em>all</em></td>
      <td><em>all</em></td>
      <td>-1</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">steemd</code></td>
      <td><code class="highlighter-rouge">network_broadcast_api</code></td>
      <td><em>all</em></td>
      <td><em>all</em></td>
      <td>-1</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">steemd</code></td>
      <td><code class="highlighter-rouge">follow_api</code></td>
      <td><em>all</em></td>
      <td><em>all</em></td>
      <td>10</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">steemd</code></td>
      <td><code class="highlighter-rouge">market_history_api</code></td>
      <td><em>all</em></td>
      <td><em>all</em></td>
      <td>1</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">steemd</code></td>
      <td><code class="highlighter-rouge">database_api</code></td>
      <td><em>all</em></td>
      <td><em>all</em></td>
      <td>3</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">steemd</code></td>
      <td><code class="highlighter-rouge">database_api</code></td>
      <td><code class="highlighter-rouge">get_block</code></td>
      <td><em>all</em></td>
      <td>-2</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">steemd</code></td>
      <td><code class="highlighter-rouge">database_api</code></td>
      <td><code class="highlighter-rouge">get_block_header</code></td>
      <td><em>all</em></td>
      <td>-2</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">steemd</code></td>
      <td><code class="highlighter-rouge">database_api</code></td>
      <td><code class="highlighter-rouge">get_content</code></td>
      <td><em>all</em></td>
      <td>1</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">steemd</code></td>
      <td><code class="highlighter-rouge">database_api</code></td>
      <td><code class="highlighter-rouge">get_state</code></td>
      <td><em>all</em></td>
      <td>1</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">steemd</code></td>
      <td><code class="highlighter-rouge">database_api</code></td>
      <td><code class="highlighter-rouge">get_state</code></td>
      <td><code class="highlighter-rouge">'/trending'</code></td>
      <td>30</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">steemd</code></td>
      <td><code class="highlighter-rouge">database_api</code></td>
      <td><code class="highlighter-rouge">get_state</code></td>
      <td><code class="highlighter-rouge">'trending'</code></td>
      <td>30</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">steemd</code></td>
      <td><code class="highlighter-rouge">database_api</code></td>
      <td><code class="highlighter-rouge">get_state</code></td>
      <td><code class="highlighter-rouge">'/hot'</code></td>
      <td>30</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">steemd</code></td>
      <td><code class="highlighter-rouge">database_api</code></td>
      <td><code class="highlighter-rouge">get_state</code></td>
      <td><code class="highlighter-rouge">'/welcome'</code></td>
      <td>30</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">steemd</code></td>
      <td><code class="highlighter-rouge">database_api</code></td>
      <td><code class="highlighter-rouge">get_state</code></td>
      <td><code class="highlighter-rouge">'/promoted'</code></td>
      <td>30</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">steemd</code></td>
      <td><code class="highlighter-rouge">database_api</code></td>
      <td><code class="highlighter-rouge">get_state</code></td>
      <td><code class="highlighter-rouge">'/created'</code></td>
      <td>10</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">steemd</code></td>
      <td><code class="highlighter-rouge">database_api</code></td>
      <td><code class="highlighter-rouge">get_dynamic_global_properties</code></td>
      <td><em>all</em></td>
      <td>1</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">overseer</code></td>
      <td><em>all</em></td>
      <td><em>all</em></td>
      <td><em>all</em></td>
      <td>5</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">conveyor</code></td>
      <td><em>all</em></td>
      <td><em>all</em></td>
      <td><em>all</em></td>
      <td>-1</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">sbds</code></td>
      <td><em>all</em></td>
      <td><em>all</em></td>
      <td><em>all</em></td>
      <td>3</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">hivemind</code></td>
      <td><em>all</em></td>
      <td><em>all</em></td>
      <td><em>all</em></td>
      <td>3</td>
    </tr>
    <tr>
      <td><code class="highlighter-rouge">yo</code></td>
      <td><em>all</em></td>
      <td><em>all</em></td>
      <td><em>all</em></td>
      <td>3</td>
    </tr>
  </tbody>
</table>

<p>In this case, requests for <code class="highlighter-rouge">login_api</code> and <code class="highlighter-rouge">network_broadcast_api</code> have a <code class="highlighter-rouge">TTL</code> of <code class="highlighter-rouge">-1</code>, which means requests with those namespaces are not cached, whereas <code class="highlighter-rouge">follow_api</code> request have a <code class="highlighter-rouge">TTL</code> of <code class="highlighter-rouge">10</code> seconds.</p>

<p>Some methods and parameters have their own <code class="highlighter-rouge">TTL</code> that overrides the general default, like <code class="highlighter-rouge">database_api.get_block</code>, which overrides <code class="highlighter-rouge">database_api.*</code>.</p>

<h5 id="time-to-live-special-meaning">Time to Live Special Meaning</h5>

<ul>
  <li><code class="highlighter-rouge">0</code> won’t expire</li>
  <li><code class="highlighter-rouge">-1</code> won’t be cached</li>
  <li><code class="highlighter-rouge">-2</code> will be cached without expiration only if it is <code class="highlighter-rouge">irreversible</code> in terms of blockchain consensus</li>
</ul>

<p>If you have a local copy of jussi (see: <a href="#installation">Installation</a>), you can change these defaults by modifying <code class="highlighter-rouge">DEV_config.json</code>.</p>

<h4 id="json-rpc-batch">json-rpc batch<a style="float: right" href="#sections"><i class="fas fa-chevron-up fa-sm"></i></a></h4>

<p>Normally, a request is made with a JSON Object (<code class="highlighter-rouge"><span class="p">{}</span></code>).  But jussi also supports batch requests, which is constructed with a JSON Array of Objects (<code class="highlighter-rouge">[{}]</code>).</p>

<p>For example, this would be a typical, non-batched JSON Object request that asks for a single block:</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>curl -s --data <span class="s1">'{"jsonrpc":"2.0", "method":"condenser_api.get_block", "params":[1], "id":1}'</span> https://api.steemit.com
</code></pre>
</div>

<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
   </span><span class="nt">"id"</span><span class="p">:</span><span class="mi">1</span><span class="p">,</span><span class="w">
   </span><span class="nt">"jsonrpc"</span><span class="p">:</span><span class="s2">"2.0"</span><span class="p">,</span><span class="w">
   </span><span class="nt">"result"</span><span class="p">:{</span><span class="w">
      </span><span class="nt">"previous"</span><span class="p">:</span><span class="s2">"0000000000000000000000000000000000000000"</span><span class="p">,</span><span class="w">
      </span><span class="nt">"timestamp"</span><span class="p">:</span><span class="s2">"2016-03-24T16:05:00"</span><span class="p">,</span><span class="w">
      </span><span class="nt">"witness"</span><span class="p">:</span><span class="s2">"initminer"</span><span class="p">,</span><span class="w">
      </span><span class="nt">"transaction_merkle_root"</span><span class="p">:</span><span class="s2">"0000000000000000000000000000000000000000"</span><span class="p">,</span><span class="w">
      </span><span class="nt">"extensions"</span><span class="p">:[</span><span class="w">

      </span><span class="p">],</span><span class="w">
      </span><span class="nt">"witness_signature"</span><span class="p">:</span><span class="s2">"204f8ad56a8f5cf722a02b035a61b500aa59b9519b2c33c77a80c0a714680a5a5a7a340d909d19996613c5e4ae92146b9add8a7a663eef37d837ef881477313043"</span><span class="p">,</span><span class="w">
      </span><span class="nt">"transactions"</span><span class="p">:[</span><span class="w">

      </span><span class="p">],</span><span class="w">
      </span><span class="nt">"block_id"</span><span class="p">:</span><span class="s2">"0000000109833ce528d5bbfb3f6225b39ee10086"</span><span class="p">,</span><span class="w">
      </span><span class="nt">"signing_key"</span><span class="p">:</span><span class="s2">"STM8GC13uCZbP44HzMLV6zPZGwVQ8Nt4Kji8PapsPiNq1BK153XTX"</span><span class="p">,</span><span class="w">
      </span><span class="nt">"transaction_ids"</span><span class="p">:[</span><span class="w">

      </span><span class="p">]</span><span class="w">
   </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
</div>

<p>To request more than one block using the batch construct, wrap each call in a JSON Array, that asks for two blocks in one request:</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>curl -s --data <span class="s1">'[{"jsonrpc":"2.0", "method":"condenser_api.get_block", "params":[1], "id":1},{"jsonrpc":"2.0", "method":"condenser_api.get_block", "params":[2], "id":2}]'</span> https://api.steemit.com
</code></pre>
</div>

<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">[</span><span class="w">
   </span><span class="p">{</span><span class="w">
      </span><span class="nt">"id"</span><span class="p">:</span><span class="mi">1</span><span class="p">,</span><span class="w">
      </span><span class="nt">"jsonrpc"</span><span class="p">:</span><span class="s2">"2.0"</span><span class="p">,</span><span class="w">
      </span><span class="nt">"result"</span><span class="p">:{</span><span class="w">
         </span><span class="nt">"previous"</span><span class="p">:</span><span class="s2">"0000000000000000000000000000000000000000"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"timestamp"</span><span class="p">:</span><span class="s2">"2016-03-24T16:05:00"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"witness"</span><span class="p">:</span><span class="s2">"initminer"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"transaction_merkle_root"</span><span class="p">:</span><span class="s2">"0000000000000000000000000000000000000000"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"extensions"</span><span class="p">:[</span><span class="w">

         </span><span class="p">],</span><span class="w">
         </span><span class="nt">"witness_signature"</span><span class="p">:</span><span class="s2">"204f8ad56a8f5cf722a02b035a61b500aa59b9519b2c33c77a80c0a714680a5a5a7a340d909d19996613c5e4ae92146b9add8a7a663eef37d837ef881477313043"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"transactions"</span><span class="p">:[</span><span class="w">

         </span><span class="p">],</span><span class="w">
         </span><span class="nt">"block_id"</span><span class="p">:</span><span class="s2">"0000000109833ce528d5bbfb3f6225b39ee10086"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"signing_key"</span><span class="p">:</span><span class="s2">"STM8GC13uCZbP44HzMLV6zPZGwVQ8Nt4Kji8PapsPiNq1BK153XTX"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"transaction_ids"</span><span class="p">:[</span><span class="w">

         </span><span class="p">]</span><span class="w">
      </span><span class="p">}</span><span class="w">
   </span><span class="p">},</span><span class="w">
   </span><span class="p">{</span><span class="w">
      </span><span class="nt">"id"</span><span class="p">:</span><span class="mi">2</span><span class="p">,</span><span class="w">
      </span><span class="nt">"jsonrpc"</span><span class="p">:</span><span class="s2">"2.0"</span><span class="p">,</span><span class="w">
      </span><span class="nt">"result"</span><span class="p">:{</span><span class="w">
         </span><span class="nt">"previous"</span><span class="p">:</span><span class="s2">"0000000109833ce528d5bbfb3f6225b39ee10086"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"timestamp"</span><span class="p">:</span><span class="s2">"2016-03-24T16:05:36"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"witness"</span><span class="p">:</span><span class="s2">"initminer"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"transaction_merkle_root"</span><span class="p">:</span><span class="s2">"0000000000000000000000000000000000000000"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"extensions"</span><span class="p">:[</span><span class="w">

         </span><span class="p">],</span><span class="w">
         </span><span class="nt">"witness_signature"</span><span class="p">:</span><span class="s2">"1f3e85ab301a600f391f11e859240f090a9404f8ebf0bf98df58eb17f455156e2d16e1dcfc621acb3a7acbedc86b6d2560fdd87ce5709e80fa333a2bbb92966df3"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"transactions"</span><span class="p">:[</span><span class="w">

         </span><span class="p">],</span><span class="w">
         </span><span class="nt">"block_id"</span><span class="p">:</span><span class="s2">"00000002ed04e3c3def0238f693931ee7eebbdf1"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"signing_key"</span><span class="p">:</span><span class="s2">"STM8GC13uCZbP44HzMLV6zPZGwVQ8Nt4Kji8PapsPiNq1BK153XTX"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"transaction_ids"</span><span class="p">:[</span><span class="w">

         </span><span class="p">]</span><span class="w">
      </span><span class="p">}</span><span class="w">
   </span><span class="p">}</span><span class="w">
</span><span class="p">]</span><span class="w">
</span></code></pre>
</div>

<p>Error responses are returned in the JSON Array response as well.  Notice the <code class="highlighter-rouge">"WRONG"</code> parameter in the second element.  The first block is returned as expected, the second one generates an error.</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>curl -s --data <span class="s1">'[{"jsonrpc":"2.0", "method":"condenser_api.get_block", "params":[1], "id":1},{"jsonrpc":"2.0", "method":"condenser_api.get_block", "params":["WRONG"], "id":2}]'</span> https://api.steemit.com
</code></pre>
</div>

<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">[</span><span class="w">
   </span><span class="p">{</span><span class="w">
      </span><span class="nt">"jsonrpc"</span><span class="p">:</span><span class="s2">"2.0"</span><span class="p">,</span><span class="w">
      </span><span class="nt">"result"</span><span class="p">:{</span><span class="w">
         </span><span class="nt">"previous"</span><span class="p">:</span><span class="s2">"0000000000000000000000000000000000000000"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"timestamp"</span><span class="p">:</span><span class="s2">"2016-03-24T16:05:00"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"witness"</span><span class="p">:</span><span class="s2">"initminer"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"transaction_merkle_root"</span><span class="p">:</span><span class="s2">"0000000000000000000000000000000000000000"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"extensions"</span><span class="p">:[</span><span class="w">

         </span><span class="p">],</span><span class="w">
         </span><span class="nt">"witness_signature"</span><span class="p">:</span><span class="s2">"204f8ad56a8f5cf722a02b035a61b500aa59b9519b2c33c77a80c0a714680a5a5a7a340d909d19996613c5e4ae92146b9add8a7a663eef37d837ef881477313043"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"transactions"</span><span class="p">:[</span><span class="w">

         </span><span class="p">],</span><span class="w">
         </span><span class="nt">"block_id"</span><span class="p">:</span><span class="s2">"0000000109833ce528d5bbfb3f6225b39ee10086"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"signing_key"</span><span class="p">:</span><span class="s2">"STM8GC13uCZbP44HzMLV6zPZGwVQ8Nt4Kji8PapsPiNq1BK153XTX"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"transaction_ids"</span><span class="p">:[</span><span class="w">

         </span><span class="p">]</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="nt">"id"</span><span class="p">:</span><span class="mi">1</span><span class="w">
   </span><span class="p">},</span><span class="w">
   </span><span class="p">{</span><span class="w">
      </span><span class="nt">"jsonrpc"</span><span class="p">:</span><span class="s2">"2.0"</span><span class="p">,</span><span class="w">
      </span><span class="nt">"error"</span><span class="p">:{</span><span class="w">
         </span><span class="nt">"code"</span><span class="p">:</span><span class="mi">-32000</span><span class="p">,</span><span class="w">
         </span><span class="nt">"message"</span><span class="p">:</span><span class="s2">"Parse Error:Couldn't parse uint64_t"</span><span class="p">,</span><span class="w">
         </span><span class="nt">"data"</span><span class="p">:{</span><span class="w">
            </span><span class="nt">"code"</span><span class="p">:</span><span class="mi">4</span><span class="p">,</span><span class="w">
            </span><span class="nt">"name"</span><span class="p">:</span><span class="s2">"parse_error_exception"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"message"</span><span class="p">:</span><span class="s2">"Parse Error"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"stack"</span><span class="p">:[</span><span class="w">
               </span><span class="p">{</span><span class="w">
                  </span><span class="nt">"context"</span><span class="p">:{</span><span class="w">
                     </span><span class="nt">"level"</span><span class="p">:</span><span class="s2">"error"</span><span class="p">,</span><span class="w">
                     </span><span class="nt">"file"</span><span class="p">:</span><span class="s2">"string.cpp"</span><span class="p">,</span><span class="w">
                     </span><span class="nt">"line"</span><span class="p">:</span><span class="mi">113</span><span class="p">,</span><span class="w">
                     </span><span class="nt">"method"</span><span class="p">:</span><span class="s2">"to_uint64"</span><span class="p">,</span><span class="w">
                     </span><span class="nt">"hostname"</span><span class="p">:</span><span class="s2">""</span><span class="p">,</span><span class="w">
                     </span><span class="nt">"timestamp"</span><span class="p">:</span><span class="s2">"2018-05-21T18:02:41"</span><span class="w">
                  </span><span class="p">},</span><span class="w">
                  </span><span class="nt">"format"</span><span class="p">:</span><span class="s2">"Couldn't parse uint64_t"</span><span class="p">,</span><span class="w">
                  </span><span class="nt">"data"</span><span class="p">:{</span><span class="w">

                  </span><span class="p">}</span><span class="w">
               </span><span class="p">},</span><span class="w">
               </span><span class="p">{</span><span class="w">
                  </span><span class="nt">"context"</span><span class="p">:{</span><span class="w">
                     </span><span class="nt">"level"</span><span class="p">:</span><span class="s2">"warn"</span><span class="p">,</span><span class="w">
                     </span><span class="nt">"file"</span><span class="p">:</span><span class="s2">"string.cpp"</span><span class="p">,</span><span class="w">
                     </span><span class="nt">"line"</span><span class="p">:</span><span class="mi">116</span><span class="p">,</span><span class="w">
                     </span><span class="nt">"method"</span><span class="p">:</span><span class="s2">"to_uint64"</span><span class="p">,</span><span class="w">
                     </span><span class="nt">"hostname"</span><span class="p">:</span><span class="s2">""</span><span class="p">,</span><span class="w">
                     </span><span class="nt">"timestamp"</span><span class="p">:</span><span class="s2">"2018-05-21T18:02:41"</span><span class="w">
                  </span><span class="p">},</span><span class="w">
                  </span><span class="nt">"format"</span><span class="p">:</span><span class="s2">""</span><span class="p">,</span><span class="w">
                  </span><span class="nt">"data"</span><span class="p">:{</span><span class="w">
                     </span><span class="nt">"i"</span><span class="p">:</span><span class="s2">"WRONG"</span><span class="w">
                  </span><span class="p">}</span><span class="w">
               </span><span class="p">},</span><span class="w">
               </span><span class="p">{</span><span class="w">
                  </span><span class="nt">"context"</span><span class="p">:{</span><span class="w">
                     </span><span class="nt">"level"</span><span class="p">:</span><span class="s2">"warn"</span><span class="p">,</span><span class="w">
                     </span><span class="nt">"file"</span><span class="p">:</span><span class="s2">"variant.cpp"</span><span class="p">,</span><span class="w">
                     </span><span class="nt">"line"</span><span class="p">:</span><span class="mi">405</span><span class="p">,</span><span class="w">
                     </span><span class="nt">"method"</span><span class="p">:</span><span class="s2">"as_uint64"</span><span class="p">,</span><span class="w">
                     </span><span class="nt">"hostname"</span><span class="p">:</span><span class="s2">""</span><span class="p">,</span><span class="w">
                     </span><span class="nt">"timestamp"</span><span class="p">:</span><span class="s2">"2018-05-21T18:02:41"</span><span class="w">
                  </span><span class="p">},</span><span class="w">
                  </span><span class="nt">"format"</span><span class="p">:</span><span class="s2">""</span><span class="p">,</span><span class="w">
                  </span><span class="nt">"data"</span><span class="p">:{</span><span class="w">
                     </span><span class="nt">"*this"</span><span class="p">:</span><span class="s2">"WRONG"</span><span class="w">
                  </span><span class="p">}</span><span class="w">
               </span><span class="p">}</span><span class="w">
            </span><span class="p">]</span><span class="w">
         </span><span class="p">}</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="nt">"id"</span><span class="p">:</span><span class="mi">2</span><span class="w">
   </span><span class="p">}</span><span class="w">
</span><span class="p">]</span><span class="w">
</span></code></pre>
</div>

<h3 id="footnotes">Footnotes<a style="float: right" href="#sections"><i class="fas fa-chevron-up fa-sm"></i></a></h3>

<ul>
  <li>Batch requests are limited to a maximum of 50 request elements.
    <ul>
      <li><em>Also see: <a href="http://www.jsonrpc.org/specification#batch">json-rpc batch specification</a></em></li>
    </ul>
  </li>
  <li>Repository: <a href="https://github.com/steemit/jussi">github.com/steemit/jussi</a></li>
</ul>

<hr />

<p><em>Latin</em></p>

<blockquote>
  <div class="highlighter-rouge"><pre class="highlight"><code>jussi

noun

declension: 2nd declension
gender: neuter

Definitions:
  1. order, command, decree, ordinance, law
</code></pre>
  </div>
</blockquote>

</div>
<div class="footer">
	<a href="#">Back to top</a>
</div>
<script>
    document.getElementById("open-nav").addEventListener("click", function () {
        document.body.classList.toggle("nav-open");
    });
</script>
</body>
</html>


<script src="/js/adjust.js"></script>

